package org.pentaho.di.core.logging;

import java.io.OutputStream;
import java.io.PrintStream;

import org.yzbdl.lanius.util.LogUtil;

public class Slf4jErrPrintStream extends PrintStream {

	public Slf4jErrPrintStream(OutputStream err) {
		super(err);
	}

	public void print(boolean b) {
		println(b);
	}

	public void print(char c) {
		println(c);
	}

	public void print(char[] s) {
		println(s);
	}

	public void print(double d) {
		println(d);
	}

	public void print(float f) {
		println(f);
	}

	public void print(int i) {
		println(i);
	}

	public void print(long l) {
		println(l);
	}

	public void print(Object obj) {
		println(obj);
	}

	public void print(String s) {
		println(s);
	}

	public void println(boolean x) {
		printToLog(Boolean.valueOf(x));
	}

	public void println(char x) {
		printToLog(Character.valueOf(x));
	}

	public void println(char[] x) {
		printToLog(x == null ? null : new String(x));
	}

	public void println(double x) {
		printToLog(Double.valueOf(x));
	}

	public void println(float x) {
		printToLog(Float.valueOf(x));
	}

	public void println(int x) {
		printToLog(Integer.valueOf(x));
	}

	public void println(long x) {
		printToLog(x);
	}

	public void println(Object x) {
		printToLog(x);
	}

	public void println(String x) {
		printToLog(x);
	}

	private void printToLog(Object message) {
		LogUtil.error(message.toString());
	}

}